home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 6 / MacMania 6.toast / / Tools&Utilities / TouchMe 1.2□ / touchMe 1.2 Folder / touchMe source codes / CW11 PP source / source / Common Lib / CDateEditField.h < prev    next >
Encoding:
Text File  |  1997-04-25  |  2.6 KB  |  81 lines  |  [TEXT/CWIE]

  1. // ==================================================
  2. //    CDateEditField.h
  3. //    Copyright (C) 1996-1997 Mizutori Tetsuya
  4. //    July 4 ,1996; February 3, 1997.
  5. // ==================================================
  6. //    All documents are pretty-printed in 10-point Geneva font.
  7.  
  8. #pragma once
  9.  
  10. #include <LEditField.h>
  11.  
  12. #include <LBroadcaster.h>
  13. #include <LListener.h>
  14.  
  15.  
  16. class CDateEditField : public LEditField, public LListener, public LBroadcaster {
  17.  
  18. public:
  19.     enum { class_ID = 'DedF' };
  20.  
  21.     static CDateEditField *    CreateDateEditFieldStream( LStream *inStream );
  22.                     CDateEditField();
  23.                     CDateEditField( const CDateEditField    &inOriginal);
  24.                     CDateEditField(
  25.                             const SPaneInfo        &inPaneInfo,
  26.                             Str255            inString,
  27.                             ResIDT            inTextTraitsID,
  28.                             Int16            inMaxChars,
  29.                             Boolean            inHasBox,
  30.                             Boolean            inHasWordWrap,
  31.                             KeyFilterFunc        inKeyFilter,
  32.                             LCommander        *inSuper);
  33.                     CDateEditField(
  34.                             const SPaneInfo        &inPaneInfo,
  35.                             Str255            inString,
  36.                             ResIDT            inTextTraitsID,
  37.                             Int16            inMaxChars,
  38.                             Uint8            inAttributes,
  39.                             KeyFilterFunc        inKeyFilter,
  40.                             LCommander        *inSuper);
  41.                     CDateEditField( LStream            *inStream);
  42.     virtual            ~CDateEditField();
  43.  
  44.     // Do nothing here
  45.     virtual void        ListenToMessage( MessageT inMessage, void * ioParam );
  46.     // Set 'mHasChanged' to true if text has been changed
  47.     virtual void        UserChangedText( void );
  48.     // Do dragging text
  49.     virtual void        ClickSelf( const SMouseDownEvent & inMouseDown );
  50.     // Do nothing here
  51.     virtual void        BeTarget( void );
  52.     // Call RefreshEditField() once when this EditField becomes no target
  53.     virtual void        DontBeTarget( void );
  54.  
  55.     // Handle dragging text in this edit field.
  56.     Boolean            DoDragText( const EventRecord &inMacEvent, const Point inMousePosition );
  57.  
  58.     // Test / Set the activity status of TextEdit
  59.     Boolean            GetTEActive( void );
  60.     void                SetTEActive( const Boolean inStatus );
  61.     // Get / Set the selection of TextEdit
  62.     void                GetSelect( long & outSelStart, long & outSelEnd );
  63.     void                SetSelect( const long inSelStart, const long inSelEnd );
  64.     // Read / Write  the text string from this EditField
  65.     void                GetText( Str255 outString );
  66.     void                SetText( const Str255 inString );
  67.     // Write text string, and then refresh it
  68.     void                SetTextAndRefresh( const Str255 inString);
  69.     // Convert date time seconds to string, and write it
  70.     void                SetDateTime( const unsigned long inDateTimeSeconds );
  71.     // Refresh the EditField if this text has been changed
  72.     void                RefreshEditField( void );
  73.  
  74. private:
  75.  
  76.     Boolean            mHasChanged;    // true if text has been changed by user's action
  77. };
  78.  
  79. // end of definitions
  80.  
  81.